#include "defines.h"
#include "kozos.h"
#include "lib.h"
#include "consdrv.h"
#include "command.h"
#include "netmain.h"

static void idle_thread(int argc, char *argv)
{
    while (1) {
        asm volatile ("sleep");
    }
}

static void start_threads(int argc, char *argv)
{
    kz_run(idle_thread, "idle", PRIORITY_NUM - 1, 0x100, 0, NULL); // startがスリープしても大丈夫

    consdrv_main();

    net_main();

    puts("KOZOS booted successfully.\n");

    kz_run(command_main, "command", 4, 0x100, 0, NULL);
}

void main(void)
{
    kz_start(start_threads, "start", 1, 0x100, 0, NULL);
}
